#include<signal.h>
#include<cstring>
#include<iostream>
#include<sys/types.h>
#include<unistd.h>
using namespace std;

void handler(int signo){
    cout<<"my signal: "<<signo<<endl;
    return ;
}

int main(){
    sigset_t mask;
    sigset_t omask;
    memset(&mask,0,sizeof(mask));
    memset(&omask,0,sizeof(omask));
    sigaddset(&mask,2);
    sigaddset(&mask,40);

    sigprocmask(SIG_SETMASK,&mask,&omask);

    signal(2,handler);
    while(true){
        cout<<"my process's pid: "<<getpid()<<endl;
        sleep(1);
    }

    return 0;
}
